<ui:composition template="/WEB-INF/templates/main-template.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">


	<ui:define name="sidebar">
		<ui:include src="/WEB-INF/templates/public-sidebar.xhtml" />
	</ui:define>
	<ui:define name="content">
		<h:form>
			<p:growl/>
			
			<h:outputText value="Create Project" styleClass="outputTextTitle"/>		
		    <p:panel header="Create New Project">    
				<h:panelGrid columns="4">
				
				<h:outputLabel value="*" style="color : red;"/>
				<h:outputLabel value="#{msg['projectname.label']}"/>
				<h:outputLabel value=" : " />
				<p:inputText  value="#{createProjectBean.project.projectName}"/>

				<h:outputLabel value="*" style="color : red;"/>
				<h:outputLabel value="Account Manager"/>
				<h:outputLabel value=" : " />
				<p:selectOneMenu value="#{createProjectBean.selectedPMId}" style="width:157px;">						
						<f:selectItems value="#{createProjectBean.ownerOfProjectMap}" /> 
				</p:selectOneMenu>
				
				<h:outputLabel value="*" style="color : red;"/>

				<h:outputLabel value="Business Line"/>
				<h:outputLabel value=" : " />
				<p:selectOneMenu value="#{createProjectBean.project.projectType}" style="width:157px;">
	           		<f:selectItem itemLabel="Implementation" itemValue="Implementation" />	
	           		<f:selectItem itemLabel="Support" itemValue="Support" />
					<f:selectItem itemLabel="Enhancement" itemValue="Enhancement" />
					<f:selectItem itemLabel="Roll-Out" itemValue="Roll-Out" />
					<f:selectItem itemLabel="Upgrade" itemValue="Upgrade" />																	
			    </p:selectOneMenu>
				
			
				
				<h:outputLabel value="*" style="color : red;"/>

				<h:outputLabel value="Customer Name"/>
				<h:outputLabel value=" : " />
				<p:inputText value="#{createProjectBean.project.client}" />

				<h:outputLabel value="*" style="color : red;"/>
				<h:outputLabel value="Customer Location"/>
				<h:outputLabel value=" : " />
				<p:inputText value="#{createProjectBean.project.clientLocation}"/>
				
				<h:outputLabel value="" style="color : red;"/>
				<h:outputLabel value="#{msg['endclient.label']}"/>
				<h:outputLabel value=" : " />
				<p:inputText value="#{createProjectBean.project.endClint}" />

				<h:outputLabel value="*" style="color : red;"/>
				<h:outputLabel value="Customer Contact Person"/>
				<h:outputLabel value=" : " />
				<p:inputText value="#{createProjectBean.project.contactPerson}" /> 
				
				<h:outputLabel value="*" style="color : red;"/>
				<h:outputLabel value="Customer Contact Number"/>
				<h:outputLabel value=" : " />
				<p:inputMask  value="#{createProjectBean.project.contactNumber}" mask="(999) 999-9999" />

				<h:outputLabel value="*" style="color : red;"/>
				<h:outputLabel value="Customer Address"/>
				<h:outputLabel value=" : " />
				<p:inputTextarea value="#{createProjectBean.project.clientAddress}"  autoResize="false" rows="3" cols="17"/>
				
				<h:outputLabel value="*" style="color : red;"/>
				<h:outputLabel value="#{msg['projectstratdate.label']}"/>
				<h:outputLabel value=" : " />
				<p:calendar pattern="dd-MMM-yyyy" value="#{createProjectBean.project.periodFrom}" />

				<h:outputLabel value="*" style="color : red;"/>
				<h:outputLabel value="#{msg['projectenddate.label']}"/>
				<h:outputLabel value=" : " />
				<p:calendar pattern="dd-MMM-yyyy" value="#{createProjectBean.project.periodTo}"/>
				
				<h:outputLabel value="*" style="color : red;"/>
				<h:outputLabel value="#{msg['noofresources.label']}"/>
				<h:outputLabel value=" : " />
				<p:inputText   value="#{createProjectBean.project.noOfResourecs}" maxlength="3"/>

				<h:outputLabel value="*" style="color : red;"/>
				<h:outputLabel value="#{msg['createdby.label']}"/>
				<h:outputLabel value=" : " />
				<p:inputText  value="#{createProjectBean.project.projectCreatedBy}" />
			</h:panelGrid>
			
			<h:panelGrid style="padding-top: 5px; width: 100%; border-top: 1px solid #d9d9d9"
						columnClasses="gridCellMiddleRightAligned">
				<h:panelGroup >
					<p:commandButton update="@form" type="button" id="submit" value="Submit"  onclick="confirmation.show()" />
					<p:commandButton value="Reset" action="createproject" /> 
			        <p:commandButton value="Home" action="wudashboard" /> 
				</h:panelGroup>
		    </h:panelGrid> 
			
			</p:panel>
			
			<p:confirmDialog widgetVar="confirmation" id="confirmation" severity="alert" message="This will submit your new project. Proceed?">
				<h:panelGroup style="text-align: right; float: right;">
					<p:commandButton value="Yes, Submit Now" actionListener="#{createProjectBean.saveProject}" update="@form" oncomplete="confirmation.hide()"/>
					<p:commandButton id="decline" value="Not Yet" onclick="confirmation.hide()" type="button" />
				</h:panelGroup>
			</p:confirmDialog>
			
		</h:form>
	</ui:define>
</ui:composition>

